Returns 1 if the given user has rights to update the group membership of the object.
#Include <AD.au3>
_AD_HasGroupUpdateRights($sObject[, $sUser = @UserName])
Parameters
| $sObject | Group to be checked. Can be specified as Fully Qualified Domain Name (FQDN) or sAMAccountName |
| $sUser | Optional: User to be checked. Can be specified as Fully Qualified Domain Name (FQDN) or SamAccountName (default = @UserName) |
Return Value
Success: 1, Specified user has the rights to update the group membership on the given group
Remarks
None.
Related
_AD_HasFullRights, _AD_HasUnlockResetRights, _AD_HasRequiredRights
See Also
http://msdn.microsoft.com/en-us/library/aa772285(VS.85).aspx (ADS_RIGHTS_ENUM Enumeration)
Example
#AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#AutoIt3Wrapper_AU3Check_Stop_OnWarning=Y
; *****************************************************************************
; Example 1
; Get a list of groups the current user is a member of. Then check for the
; first group in the array if the current user has update rights.
; *****************************************************************************
#include <AD.au3>
; Open Connection to the Active Directory
_AD_Open()
If @error Then Exit MsgBox(16, "Active Directory Example Skript", "Function _AD_Open encountered a problem. @error = " & @error & ", @extended = " & @extended)
; Get a list of groups the current user is a member of
Global $aMemberOf = _AD_GetUserGroups()
; Check if the current user has the rights to update the group membership on the first group in the array
Global $sUser = @UserName
If _AD_HasGroupUpdateRights($aMemberOf[1], $sUser) Then
MsgBox(64, "Active Directory Functions", "User '" & $sUser & "' has update rights on group '" & $aMemberOf[1] & "'")
Else
MsgBox(64, "Active Directory Functions", "User '" & $sUser & "' does not have update rights on group '" & $aMemberOf[1] & "'")
EndIf
; Close Connection to the Active Directory
_AD_Close()